#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define NOISY_TEST 1

void checkVillage_card(struct gameState *pre) {
  struct gameState post;
  int test;
  memcpy (&post, pre, sizeof(struct gameState));
  post.hand[0][0] = village;
  test = playCard(0, 0, 0, 0, &post);
  printf("player 1 plays village\n");
  assert(test == 0);
  printf("player 1 expected hand count: 5, actual: %d\n", post.handCount[0]);
  assert(post.handCount[0] == 5);
  printf("player 1 expected buy count: 1, actual: %d\n", post.numBuys);
  assert(post.numBuys == 1);
  printf("player 1 expected remaining actions: 2, actual: %d\n", post.numActions);
  assert(post.numActions == 2);
  printf("player 1 expected played card count: 1, actual: %d\n", post.playedCardCount);
  assert(post.playedCardCount == 1);
}

int test_card7() {
  int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};
  struct gameState G;
  printf ("FIXED TESTING Village Card.\n");
  initializeGame(4, k, 1, &G);
  checkVillage_card(&G);
  printf ("ALL TESTS OK\n");
  return 0;
}
